package org.example.model;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TableLineage {

    private String databaseName;

    private String databaseType;



    private String tableName;

    private String ip;
    private String port;

    private Map<String,String> options;


    private Map<String,List<ColumnLineage>> columnLineages = new HashMap<>();


    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public String getDatabaseName() {
        return databaseName;
    }

    public void setDatabaseName(String databaseName) {
        this.databaseName = databaseName;
    }

    public String getDatabaseType() {
        return databaseType;
    }

    public void setDatabaseType(String databaseType) {
        this.databaseType = databaseType;
    }




    public TableLineage(String tableName, Map<String, String> options, Map<String, List<ColumnLineage>> columnLineages) {
        this.tableName = tableName;
        this.options = options;
        this.columnLineages = columnLineages;
    }

    public TableLineage() {
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Map<String, String> getOptions() {
        return options;
    }

    public void setOptions(Map<String, String> options) {
        this.options = options;
    }

    public Map<String, List<ColumnLineage>> getColumnLineages() {
        return columnLineages;
    }

    public void setColumnLineages(Map<String, List<ColumnLineage>> columnLineages) {
        this.columnLineages = columnLineages;
    }

    public void addColumnLineages(String name,List<ColumnLineage> columnLineages) {
        if (this.columnLineages == null){
            this.columnLineages = new HashMap<>();
        }
        this.columnLineages.put(name,columnLineages);
    }
}
